# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        Young  
# Name:         less1_01
# Description:
# Author:       asus
# Date:         2019/3/23
#-------------------------------------------------------------------------------


class Person:
    def __init__(self,name,age,sex):
        print('init')
        self.name = name
        self.age = age
        self.sex = sex

    def eat(self):
        print('吃东西')

class Student(Person):
    def __init__(self,name,age,sex,collage):
        super().__init__(name,age,sex)
        self.collage = collage

    def eat(self,a):
        super().eat()
        print(a)

if __name__ == '__main__':
    p = Person('Young',20,'男')
    print(p)
    print(p.name)
    p.eat()

    print('--------------')
    s = Student('Young',20,'男','HUT')

    s.eat('芒果')










# class Person:
#     def __init__(self,age,sex,name):
#         self.name=name
#         self.age=age
#         self.sex=sex
#
#     def eat(self):
#         print('吃东西')
#
#
# class Student(Person):
#     def __init__(self,name,age,sex,college):
#         super().__init__(age,sex,name)
#         self.college=college
#
#     def eat(self,apple):
#         super().eat()
#         print(apple)
#
#
# if __name__ == '__main__':
#     p=Person(20,'女','pan')
#     print(p)
#     print(p.name)
#     p.eat()
#
#     print('---------------')
#     s=Student('yyan',20,'男','工大')
#     s.eat('菠萝')